from moviepy.editor import VideoFileClip

def extract_audio(input_file, output_file):
    video = VideoFileClip(input_file)
    audio = video.audio
    audio.write_audiofile(output_file)


if __name__ == "__main__":
    input_file = input("请输入要提取音频的MP4文件路径：")
    output_file = input("请输入提取后音频文件的保存路径：")
    extract_audio(input_file, output_file)
    print("音频提取完成，保存为:", output_file)
